//q1b.cpp
//This program takes a letter and prints a pyramid with the letter at the center.
//
//Binyamin 28 december 2017
//===========================================================================
#include<iostream>

using namespace std;

//1. Prompt the user for a char.
//2. Capture the char.
//3. print the pyramid.

int main()
{
	char c; // c - a char entered by the user.
	int i, j; // i, j - a looper for the for loop.
	cout << "Please enter a letter: ";
	cin >> c;
	for(i=0;i<= c -'a';i++)
	{
		for(j=0;j<= i ;j++)
			cout << (char)(j + 'a');	
		for(j=i-1;j>= 0 ;j--)
			cout << (char)(j + 'a');
		cout << endl;
	}
	return 0;
}
//output
//Please enter a letter: d 
//a
//aba
//abcba
//abcdcba
